<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>forward 应用程序示例</title>
</head>
<body>

	<form action="forwardExample.jsp" name="form1" method="post">
		程序示例链接： <select name="goAddress" onchange="javascript:form1.submit()">
			<option value="novalue">请选择页面：</option>
			<option value="1">示例 4-1 JSP程序的基本结构</option>
			<option value="2">示例 4-2 简单数据类型综合应用案例</option>
			<option value="3">示例 4-3 包装类综合应用实例</option>
			<option value="4">示例 4-4 省略显示长字符串实例</option>
			<option value="5">示例 4-5 一个简单的计数器</option>
			<option value="6">示例 4-6 include指令应用实例</option>
		</select>
	</form>
	<%
		// forward应用示例Java程序片
		String s = null;
		s = request.getParameter("goAddress");
		if (s != null) {
			switch (s.charAt(0)) {
			case '1':
	%>
	<jsp:forward page="../demo1_instring/instring.jsp" />
	<%
		break;
			case '2':
	%>
	<jsp:forward page="../demo2_allexample/allexample.jsp" />
	<%
		break;
			case '3':
	%>
	<jsp:forward page="../demo3_bzexample/bzexample.jsp" />
	<%
		break;
			case '4':
	%>
	<jsp:forward page="../demo4_省略显示长字字符串实例/strTruncate.jsp" />
	<%
		break;
			case '5':
	%>
	<jsp:forward page="../demo5_程序片实例_简单计数器/SimpleCounter.jsp" />
	<%
		break;
			case '6':
	%>
	<jsp:forward page="../demo6_include指令应用实例/includeSample.jsp" />
	<%
		break;
			default:
				out.println("你没有选择！");
			}
		} else {
			out.println("你没有选择！");
		}
	%>

</body>
</html>